package com.fz.mapper;

import com.fz.controller.dto.LoginDTO;
import com.fz.controller.request.BaseRequest;
import com.fz.controller.request.LoginRequest;
import com.fz.controller.request.PasswordRequest;
import com.fz.pojo.Admin;
import com.fz.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface AdminMapper {
    List<Admin> list();

    //查询用户，返回
    List<Admin> listByCondition(BaseRequest baseRequest);

    //添加用户
    void addAdmin(Admin admin);

    //通过id查询
    Admin getById(Integer id);

    void updateById(Admin admin);

    void deleteById(Integer id);

    Admin getUsernamePassword(@Param("username") String username, @Param("password") String password);

    int updatePassword(PasswordRequest passwordRequest);

    Admin getByUsername(String username);
}
